package com.project.lk.nurseapp.thermomter.presenter;

import com.project.lk.nurseapp.base.BaseApi;
import com.project.lk.nurseapp.base.BasePresenter;
import com.project.lk.nurseapp.base.ModelPresenterBridge;
import com.project.lk.nurseapp.thermomter.model.PostTemModel;

import java.util.List;

/**
 * 功能介绍：
 * 项目名：
 * 模块名称：
 * 作者：LK
 * 日期：2018/1/9
 * 修改日期：
 */
public class PostTemPresenter extends BasePresenter<IPostTemView>implements ModelPresenterBridge {
    PostTemModel postTemModel;
    public PostTemPresenter(IPostTemView view){
        postTemModel=new PostTemModel();
        postTemModel.setBridge(this);
        addView(view);
    }

    public void postTemDate(String url, String temperature, String testTesult, String recordTime){
        postTemModel.postLoadJson(url,temperature,testTesult,recordTime);
    }

    @Override
    public void bridge(int action, List list) {
        if (view!=null) {
            switch (action){
                case BaseApi.post_tem_success:
                    view.postSuccess();
                    break;
                case BaseApi.post_tem_fail:
                    view.postFail();
                    break;
            }
        }

    }
}
